Skip to content

Fix SQL Document: PostgreSQL Compatibility#15

Merged
fahimahammed merged 3 commits intofahimahammed:mainfrom
DivyanshGarg380:fix/sql-document
Oct 3, 2025
Merged

Fix SQL Document: PostgreSQL Compatibility#15
fahimahammed merged 3 commits intofahimahammed:mainfrom
DivyanshGarg380:fix/sql-document

Conversation

@DivyanshGarg380
Copy link
Copy Markdown
Contributor

Description:
This PR updates the SQL document to be fully compatible with PostgreSQL, while maintaining the original structure and comments.

Changes made:

  • Table creation & inserts
    • Fixed numeric default for budget ('undecided' → 0.00).
    • Removed duplicate inserts for primary key dept_name.
  • ALTER TABLE
    • Removed AFTER column (PostgreSQL does not support it).
    • Replaced MODIFY COLUMN with ALTER COLUMN ... TYPE.
  • LIMIT / OFFSET queries
    • Replaced MySQL-style LIMIT m,n with PostgreSQL-compatible LIMIT n OFFSET m.
  • JOINs
    • Replaced placeholder [LEFT|RIGHT] JOIN with LEFT JOIN.
  • Triggers
    • Converted MySQL DELIMITER style triggers to PostgreSQL CREATE FUNCTION ... RETURNS TRIGGER.
    • Fixed ELSEIF → ELSIF.
  • Other queries
    • Preserved original query structure and comments.
    • Ensured syntax compatibility with PostgreSQL.

Notes:

  • Placeholders like TABLE_NAME, TABLE1, TABLE2, n, m, and CONDITION should be replaced with actual values before running the queries.
  • This PR does not modify business logic, only fixes syntax and compatibility issues.

@fahimahammed fahimahammed merged commit 2137da0 into fahimahammed:main Oct 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants